const env = process.env.NODE_ENV

let MYSQL_CONFIG
let REDIS_CONFIG

switch (env) {
    // 开发环境
    case 'development':
        MYSQL_CONFIG = {
            host: 'localhost',
            user: 'root',
            password: 'root',
            port: '3306',
            database: 'myblog'
        }
        REDIS_CONFIG = {
            port: 6379,
            host: '127.0.0.1'
        }
        break
    // 生产环境
    case 'production':
        MYSQL_CONFIG = {
            host: 'localhost',
            user: 'root',
            password: 'root',
            port: '3306',
            database: 'myblog'
        }
        REDIS_CONFIG = {
            port: 6379,
            host: '127.0.0.1'
        }
        break
}

module.exports = {
    MYSQL_CONFIG,
    REDIS_CONFIG
}
